package ui;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Objects;

/**
 * @author five-five
 * @createTime 2022/2/28 15:43
 */
public class GetImage {
    public static BufferedImage getImage(String name){
        BufferedImage bufferedImage = null;
        try {
            bufferedImage = ImageIO.read(Objects.requireNonNull(GetImage.class.getResource("/img/" + name)));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return bufferedImage;
    }
}
